<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
  <input type="text" v-model="b"/> 
  <p >mes:{{b}}</p>
  <my-component v-bind:a="items"></my-component>
    </div>
</body>
<script>
    Vue.component("my-component",{
        props:["a"],
        template: '<div>{{a}}</div>'
    })
    var vm=new Vue({
        el:'#app',
        data:{
            b:'hello!',
            items:"item?"
        }, 
        methods:{
        hanld(){
            this.seen=!this.seen;
        },
        
       
        
        created: function () {
    // `this` 指向 vm 实例
    console.log('a is: ' + this.a)
      } ,
         beforeUpdate(){
            
          console.log('有数据更新')},
          updated(){
            console.log('更新完毕')},

        beforeMount(){
            console.log('挂载前')
        },
        mounted(){
            setTimeout(()=>{
                this.a='change!';
            },2000)
            
            
        }	
    
    }})
   
</script>
</html>